﻿using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;

namespace JTLeigh.Commerce.Spencer.Features.ProductFeedback.Common.Entities
{

	/// <summary>
	/// Represents all feedback for a single product by a single customer.
	/// </summary>
	[SuppressMessage("Microsoft.Naming", "CA1724:TypeNamesShouldNotMatchNamespaces", Justification = "Reviewed.")]
	public class ProductFeedback
	{

		#region Constructors

		/// <summary>
		/// Initializes a new instance of the <see cref="ProductFeedback"/> class.
		/// </summary>
		public ProductFeedback()
		{
            BadgeAssociations = new Dictionary<Guid, ProductFeedbackBadgeAssociation>();
		}

		#endregion // Constructors

		#region Properties

		/// <summary>
		/// Gets or sets the product feedback identifier.
		/// </summary>
		/// <value>A product feedback identifier <see cref="Guid"/>.</value>
		public Guid FeedbackId { get; set; }

		/// <summary>
		/// Gets or sets the culture identifier of the culture that the feedback was submitted in
		/// and that any localizable text is assumed to be written in.
		/// </summary>
		/// <value>An <see cref="Int32"/> LCID.</value>
		public int CultureId { get; set; }

		/// <summary>
		/// Gets or sets the date that the feedback was added.
		/// </summary>
		public DateTime DateAdded { get; set; }

		/// <summary>
		/// Gets or sets the customer identifier of the customer who submitted the feedback.
		/// </summary>
		/// <value>A customer identifier <see cref="Guid"/>, or <see langword="null"/> if the 
		/// feedback was not submitted by a known customer (i.e. if the feedback is anonymous).</value>
		public Guid? CustomerId { get; set; }

		/// <summary>
		/// Gets or sets the name of the customer who submitted the feedback.
		/// </summary>
		public string CustomerName { get; set; }

		/// <summary>
		/// Gets or sets the location of the customer who submitted the feedback.
		/// </summary>
		public string CustomerLocation { get; set; }

		/// <summary>
		/// Gets or sets the editor comments.
		/// </summary>
		/// <remarks>
		/// <para>
		/// The editor comments are associated with the feedback, not the review component, because 
		/// other components might have qualitative elements.
		/// </para>
		/// </remarks>
		public string EditorComments { get; set; }

        /// <summary>
        /// Gets or sets the product feedback badge associations of the product feedback.
        /// </summary>
        public Dictionary<Guid, ProductFeedbackBadgeAssociation> BadgeAssociations { get; private set; }

		/// <summary>
		/// Gets or sets the product rating component of the product feedback.
		/// </summary>
		/// <value>A <see cref="ProductRating"/> object, or <see langword="null"/> if the feedback
		/// does not have a rating component.</value>
		public ProductRating Rating { get; set; }

		/// <summary>
		/// Gets or sets the product recommendation component of the product feedback.
		/// </summary>
		/// <value>A <see cref="ProductRecommendation"/> object, or <see langword="null"/> if the 
		/// feedback does not have a recommendation component.</value>
		public ProductRecommendation Recommendation { get; set; }

		/// <summary>
		/// Gets or sets the product review component of the product feedback.
		/// </summary>
		/// <value>A <see cref="ProductReview"/> object, or <see langword="null"/> if the feedback
		/// does not have a review component.</value>
		public ProductReview Review { get; set; }

		#endregion // Properties

	}

}
